package org.budo.validation.exception;

import org.hibernate.validator.constraints.NotBlank;

/**
 * @author lmw
 */
public class BudoNotBlankValidationException extends AbstractBudoValidationException {
    private static final long serialVersionUID = -7902067663084373068L;

    private static final String MESSAGE_DEFAULT = "{org.hibernate.validator.constraints.NotBlank.message}";

    public BudoNotBlankValidationException() {}

    public BudoNotBlankValidationException(Integer parameterIndex, String parameterName, NotBlank notBlank, Object argumentValue) {
        super(parameterIndex, parameterName, notBlank, argumentValue, validationMessage(notBlank.message(), MESSAGE_DEFAULT));
    }

    protected String buildMessage() {
        return "parameter[" + this.getParameterIndex() + "] " + this.getParameterName() + " should not be blank";
    }
}